package ar.edu.unq.tpi.uis.tepe3.wicket.extensions;

import javax.swing.tree.TreeNode;

import org.apache.wicket.ResourceReference;
import org.apache.wicket.extensions.markup.html.tree.table.IColumn;
import org.apache.wicket.extensions.markup.html.tree.table.TreeTable;

/**
 * La idea es sacar el icono de archivo.
 * 
 * @author gpilla
 *
 */
public class OnlyFolderTreeTable extends TreeTable {

	public OnlyFolderTreeTable(String id, IColumn[] columns) {
		super(id, columns);
	}
	
	/**
	 * Returns the resource reference for icon of specified tree node.
	 * 
	 * @param node
	 *            The node
	 * @return The package resource reference
	 */
	protected ResourceReference getNodeIcon(TreeNode node)
	{
		if (node.isLeaf() == true)
		{
			return getFolderClosed();
		}
		else
		{
			if (isNodeExpanded(node))
			{
				return getFolderOpen();
			}
			else
			{
				return getFolderClosed();
			}
		}
	}

}
